Skip to content

Conversation

@rljacob
Copy link
Member

@rljacob rljacob commented Aug 2, 2023

Following directions on codecov site to add it as a github action.

Following directions on codecov site to add it
has a github action.
@rljacob
Copy link
Member Author

rljacob commented Aug 2, 2023

What the directions say: "After you committed your changes [this PR] and ran the repo's CI/CD pipeline. In your pull request, you should see two status checks and PR comment.
Once merged to the default branch, subsequent pull requests will have checks and report comment. Additionally, you'll find your repo coverage dashboard here."

@jayeshkrishna jayeshkrishna requested a review from dqwu August 2, 2023 20:37
@dqwu
Copy link
Contributor

dqwu commented Aug 3, 2023

@rljacob @jayeshkrishna
It seems that most tutorials use *.yml instead of *.yaml for a workflow file.

@dqwu
Copy link
Contributor

dqwu commented Aug 3, 2023

@rljacob @jayeshkrishna
This tutorial uses a simple C example:
https://about.codecov.io/blog/how-to-set-up-codecov-with-c-and-github-actions

Its workflow file (ci.yml) is

name: Workflow for Codecov example-c
on: [push, pull_request]
jobs:
  run:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Compile calculator
        run: gcc -fprofile-arcs -ftest-coverage -O0 -o test_calculator test_calculator.c calculator.c
      - name: Run tests
        run: ./test_calculator
      - name: Upload coverage to Codecov
        uses: codecov/codecov-action@v3
        with:
          gcov: true
          gcov_include: calculator.c

For SCORPIO, we also need the checkout/build/run steps to generate GCOV files. Also, SCORPIO uses CMake and it has a lot of dependent libs (netcdf/pnetcdf/...). The workflow file might be complicate like this one:
https://github.com/pybind/pybind11/blob/master/.github/workflows/ci.yml

When configuring SCORPIO, we need turn on PIO_ENABLE_COVERAGE CMake option to add GCOV -fprofile-arcs -ftest-coverage flags.

@rljacob
Copy link
Member Author

rljacob commented Aug 14, 2023

Ok I guess its not as simple as they suggested. https://app.codecov.io/gh/E3SM-Project/scorpio/new

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants